range: Don't perform a GTK+ grab
authorCarlos Garnacho <carlosg@gnome.org>
Wed, 4 Jan 2012 23:27:57 +0000 (00:27 +0100)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 23 Feb 2012 21:47:06 +0000 (16:47 -0500)
The implicit grab on priv->event_window already warrants that this
widget is the only one getting events while the button is pressed,
so avoid the extra GTK+ grab here.

gtk/gtkrange.c

index 0d32f0bb02af1d3bb997c76b39badbbf453491ad..445e6fe9cae8b7741a0c2d444ecd97d68cf6c010 100644 (file)
@@ -2347,15 +2347,11 @@ range_grab_add (GtkRange      *range,
   if (device == priv->grab_device)
     return;
 
-  if (priv->grab_device != NULL)
-    {
-      g_warning ("GtkRange already had a grab device, releasing device grab");
-      gtk_device_grab_remove (GTK_WIDGET (range), priv->grab_device);
-    }
-
-  /* we don't actually gdk_grab, since a button is down */
-  gtk_device_grab_add (GTK_WIDGET (range), device, TRUE);
-
+  /* Don't perform any GDK/GTK+ grab here. Since a button
+   * is down, there's an ongoing implicit grab on
+   * priv->event_window, which pretty much guarantees this
+   * is the only widget receiving the pointer events.
+   */
   priv->grab_location = location;
   priv->grab_button = button;
   priv->grab_device = device;